package com.cbtx.module_sp.ui.window;

import android.widget.ImageView;

import androidx.annotation.Nullable;

import com.bumptech.glide.Glide;
import com.cbtx.module_sp.R;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;

import java.util.List;

public class MainMenuAdapter2 extends BaseQuickAdapter<MainMenuBean2, BaseViewHolder> {

    public MainMenuAdapter2(@Nullable List<MainMenuBean2> data) {
        super( R.layout.item_main_menu,data);
    }

    @Override
    protected void convert(BaseViewHolder helper, MainMenuBean2 item) {

        ImageView ivIcon = helper.getView(R.id.iv_main_menu);
        if(helper.getLayoutPosition() == 0){
            Glide.with(mContext).load(item.iconId).into(ivIcon);
        }else{
            Glide.with(mContext).load(item.iconUrl).into(ivIcon);
        }
    }
}
